<template>
  <div>
    <LoadingCom></LoadingCom>
    <HeaderCom v-if="!route.meta.tdivide"> </HeaderCom>
    <router-view v-slot="{ Component }">
      <component :is="Component" />
    </router-view>
    <FooterCom v-if="!route.meta.bdivide"></FooterCom>
  </div>
</template>

<script setup lang="ts">
import HeaderCom from "@/components/headerCom.vue";
import FooterCom from "@/components/footerCom.vue";
import LoadingCom from "@/components/loadingCom.vue";
import storage from "@/utils/storage";
import { useRoute } from "vue-router";
import { useRouter } from "vue-router";
const route = useRoute();
const router = useRouter();
const init = () => {
  if (storage.get("token")) {
    // showToast("已登录");
    if (route.path == "/login") {
      router.replace("/qr");
    }
  } else {
    return;
  }
};
init();
</script>

<style lang="scss">
@import "./style.scss";
body {
  font-size: 12px;
}
</style>
